<script th:src="head.min.js"></script>
<script type="text/javascript" th:src="@{${#themes.code('cas.javascript.file')}}"></script>

<script th:inline="javascript">
head.ready(document, function () {
    if (!window.jQuery) {
    	var jqueryUrl = /*[[@{jquery.min.js}]]*/; 
        head.load(jqueryUrl, loadjQueryUI);
    } else {
        notifyResourcesAreLoaded(resourceLoadedSuccessfully);
    }
});
function loadjQueryUI() {
	var jqueryUrl = /*[[@{jquery-ui.min.js}]]*/; 
	head.load(jqueryUrl, loadjQueryCookies);
}
function loadjQueryCookies() {
	var jqueryUrl = /*[[@{jquery.cookie.js}]]*/; 
	head.load(jqueryUrl, notifyResourcesAreLoaded(resourceLoadedSuccessfully));
}
function notifyResourcesAreLoaded(callback) {
    if (typeof callback === "function") {
        callback();
    }
}
</script>
